package capricornus.scene
{
	import capricornus.components.skill.SkillManager;
	import capricornus.core.StageManager;
	
	import flash.events.EventDispatcher;

	public class SceneManager extends EventDispatcher
	{
		public static const instance:SceneManager = new SceneManager();
		
		private var _scene:AbstractScene;
		
		public function SceneManager()
		{
		}
		
		public function initialize( sceneClass:Class=null ):void
		{
			_scene = sceneClass==null?(new AbstractScene()):(new sceneClass() as AbstractScene);
			
			StageManager.stage.addChildAt( _scene, 0 );
			
			SkillManager.instance.initialize();
		}
		
		public function get scene():AbstractScene
		{
			return _scene;
		}
	}
}